import nearest_interpolation_v1
import nearest_interpolation
import nearest_interpolation_v2
import cv2
import time

img = cv2.imread('cat.png')
cv2.imshow('show', img)
cv2.waitKey(0)
cv2.destroyAllWindows()

t1 = time.time()
img_n0 = nearest_interpolation(img, (512, 512))
t2 = time.time()
img_n1 = nearest_interpolation_v1(img, (512, 512))
t3 = time.time()
img_n2 = nearest_interpolation_v2(img, (512, 512))
t4 = time.time()
print('Difference 0-1: ', ((img_n0 - img_n1)**2).sum())
print('Difference 0-2: ', ((img_n0 - img_n2)**2).sum())
print('Difference 1-2: ', ((img_n1 - img_n2)**2).sum())
print('v0: %.6f' % (t2 - t1))
print('v1: %.6f' % (t3 - t2))
print('v2: %.6f' % (t4 - t3))

